# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=maliit-keyboard
pkgver=2.2.1.1
pkgrel=0
pkgdesc="Maliit Keyboard 2"
# armhf blocked by qt5-qtdeclarative
# s390x blocked by libpinyin
arch="all !armhf !s390x"
url="https://github.com/maliit/keyboard"
license="LGPL-3.0-only AND BSD-3-Clause AND CC-BY-SA-3.0"
depends="dconf"
makedepends="
	anthy-dev
	cmake
	glib-dev
	hunspell-dev
	libpinyin-dev
	maliit-framework-dev
	presage-dev
	qt5-qtbase-dev
	qt5-qtfeedback-dev
	qt5-qtmultimedia-dev
	"
checkdepends="xvfb-run"
source="$pkgname-$pkgver.tar.gz::https://github.com/maliit/keyboard/archive/$pkgver/keyboard-$pkgver.tar.gz"
subpackages="$pkgname-doc"
options="!check" # Disabled
builddir="$srcdir/keyboard-$pkgver"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-Denable-tests=OFF # Broken https://github.com/maliit/keyboard/issues/7
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
89e15972741539bf5b3c36bb70e75baf6688158a06b3c5f89aed51562a9dfec1e39d262036d9ea843b1ffb4a6f3b387d531d73914b7fe7893d9a464d236323ca  maliit-keyboard-2.2.1.1.tar.gz
"
